#include <iostream>
using namespace std;
int main() {
  int arr[] = {2, 7, 3, 8, 9};
  cout << "倒排前顺序" << endl;
  for (int i = 0; i < 5; i++) {
    cout << arr[i] << endl;
  }
  int start = 0;
  int end = sizeof(arr) / sizeof(arr[0]) - 1;

  int temp = 0;
  while (start < end) {
    temp = arr[start];
    arr[start] = arr[end];
    arr[end] = temp;
    start++;
    end--;
  }
  cout << "到排后顺序" << endl;
  for (int i = 0; i < 5; i++) {
    cout << arr[i] << endl;
  }
  return 0;
}
